// ============================================================ //
function Size (width, height)
{
	this.Width = typeof width != "undefined" ? width : "Auto";
	this.Height = typeof height != "undefined" ? height : "Auto";

	this.toString = function()
	{
		return this.Width + ", " + this.Height;
	};

	this.fromString = function(str)
	{
		var data = str.split(",");
		this.Width = data[0];
		this.Height = data[1];
	};
}

// ============================================================ //
function Coord (x, y)
{
	this.X = typeof x != "undefined" ? x : 0;
	this.Y = typeof y != "undefined" ? y : 0;

	this.toString = function()
	{
		return this.X + ", " + this.Y;
	};

	this.fromString = function(str)
	{
		var data = str.split(",");
		this.X = parseInt(data[0], 10);
		this.Y = parseInt(data[1], 10);
	};
}

// ============================================================ //
function Border(type, color, width)
{
	this.Style = typeof type != "undefined" ? type : "Solid";
	this.Color = typeof color != "undefined" ? color : "Black";
	this.Width = typeof width != "undefined" ? width : "1px";

	this.toString = function()
	{
		return this.Style + ", " + this.Color + ", " + this.Width;
	};

	this.fromString = function(str)
	{
		var data = str.split(",");
		this.Style = data[0];
		this.Color = data[1];
		this.Width = data[2];
	};
}

// ============================================================ //
function Font(family, size, color, aligment, style, weight)
{
	this.Family = 	typeof family != "undefined" ? family : "Arial"; 
	this.Size = 	typeof size != "undefined" ? size : "12px";
	this.Color = 	typeof color != "undefined" ? color : "Black";
	this.Alignment = typeof aligment != "undefined" ? aligment : "Center";
	this.Style = 	typeof style != "undefined" ? style : "Normal";
	this.Weight = 	typeof weight != "undefined" ? weight : "Normal";

	this.toString = function()
	{
		return this.Family + ", " + this.Size + ", " + this.Color + ", " + this.Alignment + ", " + this.Style + ", " + this.Weight;
	};

	this.fromString = function(str)
	{
		var data = str.split(",");
		this.Family = data[0];
		this.Size = data[1];
		this.Color = data[2];
		this.Alignment = data[3];
		this.Style = data[4];
		this.Weight = data[5];
	};
}

// ============================================================ //
function VideoSource(source, mimetype)
{
	this.Source = typeof source != "undefined" ? source : "";
	this.MimeType = typeof mimetype != "undefined" ? mimetype : "";

	this.toString = function()
	{
		return this.Source + ", " + this.MimeType;
	};

	this.fromString = function(str)
	{
		var data = str.split(",");
		this.Source = data[0];
		this.MimeType = data[1];
	};
}